source("funcs_and_cons.R")

stats <- fread(paste0(dir.generated,'r/morg_sumstats_table.csv'))
stats.all <- fread(paste0(dir.generated,'r/morg_sumstats_all_table.csv'))

emp_sh_M <- rnd2(100*stats$empl.sh[stats$cat3=='svc'][1])
emp_sh_R <- rnd2(100*stats$empl.sh[stats$cat3=='rt'][1])
emp_sh_C <- rnd2(100*stats$empl.sh[stats$cat3=='abs'][1])

w_M <- rnd2(stats$hrwage16.mean[stats$cat3=='svc'][1])
w_R <- rnd2(stats$hrwage16.mean[stats$cat3=='rt'][1])
w_C <- rnd2(stats$hrwage16.mean[stats$cat3=='abs'][1])

w <- rnd2(stats.all$hrwage16.mean[1])

w_sd_M <- rnd2(stats$hrwage16.sd[stats$cat3=='svc'][1])
w_sd_R <- rnd2(stats$hrwage16.sd[stats$cat3=='rt'][1])
w_sd_C <- rnd2(stats$hrwage16.sd[stats$cat3=='abs'][1])

w_sd <- rnd2(stats.all$hrwage16.sd[1])

# Schooling shares

school_1_M <- rnd2(100*stats$school.sh[(stats$cat3=='svc')&(stats$schooling=='less than highschool')][1])
school_2_M <- rnd2(100*stats$school.sh[(stats$cat3=='svc')&(stats$schooling=='highschool')][1])
school_3_M <- rnd2(100*stats$school.sh[(stats$cat3=='svc')&(stats$schooling=='some college')][1])
school_4_M <- rnd2(100*stats$school.sh[(stats$cat3=='svc')&(stats$schooling=='college')][1])
school_5_M <- rnd2(100*stats$school.sh[(stats$cat3=='svc')&(stats$schooling=='more than college')][1])

school_1_R <- rnd2(100*stats$school.sh[(stats$cat3=='rt')&(stats$schooling=='less than highschool')][1])
school_2_R <- rnd2(100*stats$school.sh[(stats$cat3=='rt')&(stats$schooling=='highschool')][1])
school_3_R <- rnd2(100*stats$school.sh[(stats$cat3=='rt')&(stats$schooling=='some college')][1])
school_4_R <- rnd2(100*stats$school.sh[(stats$cat3=='rt')&(stats$schooling=='college')][1])
school_5_R <- rnd2(100*stats$school.sh[(stats$cat3=='rt')&(stats$schooling=='more than college')][1])

school_1_C <- rnd2(100*stats$school.sh[(stats$cat3=='abs')&(stats$schooling=='less than highschool')][1])
school_2_C <- rnd2(100*stats$school.sh[(stats$cat3=='abs')&(stats$schooling=='highschool')][1])
school_3_C <- rnd2(100*stats$school.sh[(stats$cat3=='abs')&(stats$schooling=='some college')][1])
school_4_C <- rnd2(100*stats$school.sh[(stats$cat3=='abs')&(stats$schooling=='college')][1])
school_5_C <- rnd2(100*stats$school.sh[(stats$cat3=='abs')&(stats$schooling=='more than college')][1])

## schooling shares all
school_1 <- rnd2(100*stats.all$school.sh[(stats.all$schooling=='less than highschool')][1])
school_2 <- rnd2(100*stats.all$school.sh[(stats.all$schooling=='highschool')][1])
school_3 <- rnd2(100*stats.all$school.sh[(stats.all$schooling=='some college')][1])
school_4 <- rnd2(100*stats.all$school.sh[(stats.all$schooling=='college')][1])
school_5 <- rnd2(100*stats.all$school.sh[(stats.all$schooling=='more than college')][1])
